package com.corgi.test.retry;

import net.sf.cglib.proxy.Enhancer;

/**
 * RetryProxy
 *
 * @title: RetryProxy
 * @description:
 * @author: dengmiao
 * @create: 2020-06-10 10:10
 **/
public class RetryProxy {

    public Object newProxyInstance(Object target){
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(target.getClass());
        enhancer.setCallback(new AnnotationAwareRetryOperationsInterceptor());
        return enhancer.create();
    }
}
